<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:composition template="/template/NoFrameTemplate.xhtml">
        <ui:define name="content">
            <h:form>
                <p:panel header="Change Password">
                    <h:panelGrid columns="3">

                        <h:outputLabel value="Email: " for="email" />
                        <p:inputText id="email" value="#{passwordChangeRequestController.passwordChangeRequestEmail}" required="true" requiredMessage="Email is missing">
                        </p:inputText>
                        <h:message styleClass="errorMsg" for= "email" />
                        
                        <h:outputLabel value="Contact Number: " />
                        <p:inputText id="contactNumber" value="#{passwordChangeRequestController.contactNumber}" required="true" requiredMessage="Contact is missing">
                        </p:inputText>
                        <h:outputText value=" " />

                        <h:outputLabel value="New Password" for="password" />
                        <p:password id="password" binding="#{password}" value="#{passwordChangeRequestController.newPassword}" minLength="6" feedback="true" required="true" requiredMessage="New PassWord is missing">
                        </p:password>
                        <h:message styleClass="errorMsg" for="password" />

                        <h:outputLabel for="confirm" value="Confirm password:" />
                        <p:password id="confirm" required="true" minLength="6" feedback="true" requiredMessage="PassWord is missing">
                            <f:validator validatorId="macTeam.PasswordValidator" />
                            <f:attribute name="password" value="#{password.value}" />
                        </p:password>
                        <h:message styleClass="errorMsg" for="confirm" />                                                       

                    </h:panelGrid>

                    <br />
                    <h:commandButton action="#{passwordChangeRequestController.resetPassword}" value="submit" >
                        <f:param name="hashId" value="#{param['hashId']}" />
                        <f:attribute name="hashIdAtt" value="#{param['hashId']}" />
                    </h:commandButton>
                    <br />
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
